<html>

<head>
  <title>JUHUSLIKKUSE MUSTER</title>

  <link href="style.css" rel="stylesheet" type="text/css">
</head>

<?php
require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt11 = $m[$random];
mysql_close();

require "ab.inc.php";

	   $sqlcmd="select*from mustrid order by id";
       $result=mysql_query($sqlcmd);

       $m=array();

       while($myrow = mysql_fetch_array($result))
       {
           if  ($myrow["kuvamine"]==1 & $myrow["pilt"] != $pilt11)
            {
                array_push($m, $myrow["pilt"]);
            }

       }

$random = array_rand($m);
$pilt22 = $m[$random];
mysql_close();

echo"<body background=imgs/".$pilt11.">

<table width=900 height=900 align=center valign=middle>
<tr>

<td background=imgs/".$pilt22." align=center valign=middle>

<table width=400 height=400 align=center valign=middle>
<tr>

<td bgcolor=#ffffff align=center valign=middle class=kiri>

<table align=center valign=middle>
<tr><td align=center valign=middle colspan=2>&nbsp;</a></td></tr>";

require "ab.inc.php";

$sqlcmd="select*from mustrid order by id";
$result=mysql_query($sqlcmd);

 while($myrow = mysql_fetch_array($result))
 {

 if (strlen($myrow["id"]))
 {
         $id=$myrow["id"];
         $pilt=$myrow["pilt"];

		 if ($myrow["kuvamine"]==1)
         echo"<tr><td align=center valign=middle><b><font color=#cccccc>id: ".$myrow["id"]."</font></b> - <a href=\"muuda_pilt_b.php?i=$id\"><b>".$pilt."</a></td>
         <td align=center valign=middle><img src=\"imgs/".$pilt."\" width=\"20\" border=\"1\" valign=\"top\">
         </td></tr>";

         else
         echo"<tr><td align=center valign=middle><b><span class=\"peida\">id: ".$myrow["id"]."</b> - <a href=\"muuda_pilt_b.php?i=$id\"><b>".$pilt."</a></span></td>
         <td align=center valign=middle><img src=\"imgs/".$pilt."\" width=\"20\" border=\"1\" valign=\"top\">
         </td></tr>";
  }
 }
mysql_close();
?>

<tr><td align=center valign=middle colspan=2><br />
<a href="index.php">Algusesse</a></td></tr>

</table>
</td>

</tr>
</table>

</td>

</tr>
</table>


</body>

</html>